<div align="center">
  <DIV class=boxright>
    <DIV class=bltop2>
      <div align="left">&nbsp;&nbsp;&nbsp;
        <strong>
          &nbsp;&nbsp;&nbsp;当前位置：用户个人信息管理
        </strong>      
      </div>
    </DIV>
    <DIV class=c_box>
      <DIV class="rep_left">
        <%=flash[:notice]%>
        <%form_tag :controller=>"permission", :action=>"save_user" ,:id=>@user.id do%>                                             
          <TABLE id=tblSearch  cellSpacing=0 cellPadding=4 width="100%" border=0>
            <TBODY>
              <TR>
                <TD class=rtdp height=22 ALIGN="left"><STRONG>个人信息修改</STRONG></TD>
                <TD class=rtdp align="right" COLSPAN="3">&nbsp;</TD>
              </TR>
              <TR>
                <TD COLSPAN="4" class=rep_li_c2 width="20%" ALIGN="left">
                  <span id="ulogin_name"></span>
                &nbsp;</TD>
              </TR>
              <TR>
                <TD class=rep_li_c2 width="20%" ALIGN="left">登录名</TD>
                <TD class=rep_li_c2 width="30%" ALIGN="left">
                  <%= text_field "user","login_name",:class=>"text", :style=>"WIDTH: 130px"%>
                </TD>
                <TD class=rep_li_c2 width="20%" ALIGN="left">真实姓名</TD>
                <TD class=rep_li_c2 width="30%" ALIGN="left">
                  <%= text_field "user","true_name",:class=>"text", :style=>"WIDTH: 130px"%>
                </TD>
              </TR>
              <TR>
                <TD class=rep_li_c2 ALIGN="left">单位</TD>
                <TD class=rep_li_c2 ALIGN="left"><%= text_field "user","depart",:class=>"text", :style=>"WIDTH: 130px"%></TD>
                <TD class=rep_li_c2 ALIGN="left">电话</TD>
                <TD class=rep_li_c2 ALIGN="left"><%= text_field "user","telephone",:class=>"text", :style=>"WIDTH: 130px"%></TD>
              </TR>
              <TR>
                <TD class=rep_li_c2 colSpan=4>
                  <INPUT ONCLICK="return onadd();" onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'" class=submit id="modify" type=submit value="修改" name="">
                  <INPUT onMouseOver="this.className='reset2'" onMouseOut="this.className='reset'" id="btn8" class="reset"  type="reset" value=取消>
                </TD>
              </TR>
            </TBODY>
          </TABLE>
        <%end%>     
        <%= observe_field("user[login_name]",:frequency => 1,:update => :ulogin_name,:url => {:controller=>"permission",:action => :check_login_name},:with=>"login_name") %>															
        
        <%form_tag :controller=>"permission", :action=>"modify_password" ,:id=>@user.id do%>                                             
          <TABLE id=tblSearch  cellSpacing=0 cellPadding=4 width="100%" border=0>
            <TBODY>
              <TR>
                <TD class=rtdp height=22 ALIGN="left"><STRONG>修改密码</STRONG></TD>
                <TD class=rtdp align="right" COLSPAN="3">&nbsp;</TD>
              </TR>
              <TR>
                <TD class=rep_li_c2 width="20%" ALIGN="left">旧密码</TD>
                <TD class=rep_li_c2 width="30%" ALIGN="left">
                  <input id="old_pass" type="password" name="old_pass" class="text" style="WIDTH: 230px">
                </TD>
                <TD class=rep_li_c2 width="20%" ALIGN="left">
                  <span id="sp_oldpwd"></span>
                &nbsp;</TD>
              </TR>
              <TR>
                <TD class=rep_li_c2 ALIGN="left">新密码</TD>
                <TD class=rep_li_c2 ALIGN="left"><input id="new_pass" type="password" name="new_pass" class="text" style="WIDTH: 230px"></TD>
                <TD class=rep_li_c2 ALIGN="left">&nbsp;</TD>
              </TR>
              <TR>
                <TD class=rep_li_c2 ALIGN="left">确认新密码</TD>
                <TD class=rep_li_c2 ALIGN="left"><input id="con_pass" type="password" name="conf_pass" class="text" style="WIDTH: 230px"></TD>
                <TD class=rep_li_c2 ALIGN="left">&nbsp;</TD>   
              </TR>
              <TR>
                <TD class=rep_li_c2 colSpan=4>
                  <INPUT onclick="return pass_change();" onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'" class=submit id="btn_save" type=submit value="修改">
                  <INPUT onMouseOver="this.className='reset2'" onMouseOut="this.className='reset'" id="btn8" class="reset"  type="reset" value=取消>
                </TD>
              </TR>
            </TBODY>
          </TABLE>
          <%= observe_field(:old_pass,:frequency => 1,:update => :sp_oldpwd,:url => {:controller=>"permission",:action => :check_old_password},:with=>"old_pass") %>															
        
        <%end%>           
      </DIV>
    </DIV>
    <SCRIPT type="text/javascript">
        iniControlsEvent(document.forms[0]);
        var mid;
        function isCheckAll(){
            var chkm=$("chkAll");
            var chks=document.getElementsByName("chkID[]");
            for(var i=0;i<chks.length;i++){
                chks[i].checked=chkm.checked;
            }
            sltObj();
        }
        sltObj();
        function sltObj(){
            mid=getChecksValue("chkID[]").id;
            var chkCounts=getChecksValue("chkID[]").cnt;
            changeSmlButtonCss("edit_user",chkCounts==1?true:false);
            changeBigButtonCss("setpass",chkCounts>0?true:false);
            changeBigButtonCss("setRole",chkCounts>0?true:false);
            changeSmlButtonCss("use",chkCounts>0?true:false);
            changeSmlButtonCss("unuse",chkCounts>0?true:false);
        }
        
        function onadd()
        {
            if($F("user[login_name]")=="")
            {
                alert("请输入登录名！");
                return false;
            }
            if($F("user[true_name]")=="")
            {
                alert("请输入真实姓名！");
                return false;
            }
            if($F("user[depart]")=="")
            {
                alert("请输入单位！");
                return false;
            }
            return true;
        }
        
        function pass_change()
        {
            if($F("old_pass")=="")
            {
                alert("请输入旧密码！");
                return false;
            }
            if($F("new_pass")=="")
            {
                alert("请输入新密码！");
                return false;
            }
            if($F("con_pass")=="")
            {
                alert("请输入确认新密码！");
                return false;
            }
            
            if($F("new_pass")!=$F("con_pass"))
            {
                alert("两次输入的密码不同，请重新输入");
                $("new_pass").value="";
                $("con_pass").value="";
                $("new_pass").focus();
                return false;
            }
            return true;
        }
    </SCRIPT>
  </DIV>
</div>

